package com.huabo.system.service.impl;

import com.hbfk.util.PageInfo;
import com.huabo.system.config.DateBaseConfig;
import com.huabo.system.mysql.entity.TblMonitorSolutionMySql;
import com.huabo.system.mysql.mapper.TblMonitorSolutionMySqlMapper;
import com.huabo.system.oracle.entity.TblMonitorSolution;
import com.huabo.system.oracle.mapper.TblMonitorSolutionMapper;
import com.huabo.system.service.TblMonitorSolutionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Service
public class TblMonitorSolutionServiceImpl implements TblMonitorSolutionService {

    @Resource
    private TblMonitorSolutionMapper tblMonitorSolutionMapper;

    @Resource
    private TblMonitorSolutionMySqlMapper tblMonitorSolutionMySqlMapper;


    @Override
    public Map<String, Object> tblMonitorSolutionService(BigDecimal staffid, PageInfo<TblMonitorSolution> pageInfo, String type) {
            Map<String, Object> resultMap = new HashMap<String, Object>(0);
            pageInfo.setTlist(this.tblMonitorSolutionMapper.tblMonitorSolutionService(pageInfo, staffid, type));
            pageInfo.setTotalRecord(this.tblMonitorSolutionMapper.tblMonitorSolutionServiceCount(staffid, type));
            resultMap.put("code", 1);
            resultMap.put("msg", "访问接口成功");
            resultMap.put("data", pageInfo);
            return resultMap;
    }

    @Override
    public Map<String, Object> tblMonitorSolutionMySqlService(BigDecimal staffid, PageInfo<TblMonitorSolutionMySql> pageInfo, String type) {
        Map<String, Object> resultMap = new HashMap<String, Object>(0);
        pageInfo.setTlist(this.tblMonitorSolutionMySqlMapper.tblMonitorSolutionService(pageInfo, staffid, type));
        pageInfo.setTotalRecord(this.tblMonitorSolutionMySqlMapper.tblMonitorSolutionServiceCount(pageInfo,staffid, type));
        resultMap.put("code", 1);
        resultMap.put("msg", "访问接口成功");
        resultMap.put("data", pageInfo);
        return resultMap;
    }

    @Override
    public TblMonitorSolution findOne(String solutionid) {
        return tblMonitorSolutionMapper.selectSolutionid(solutionid);
    }

    @Override
    public TblMonitorSolutionMySql findMySqlOne(String solutionid) {
        return tblMonitorSolutionMySqlMapper.selectSolutionid(solutionid);
    }

}
